package com.tulele.vtool.service.impl;

import com.tulele.vtool.mapper.ArticleTailAdvertInfoMapper;
import com.tulele.vtool.model.ArticleTailAdvertInfo;
import com.tulele.vtool.model.combinedEntity.UserAdvertList;
import com.tulele.vtool.model.combinedEntity.UserAdvertType;
import com.tulele.vtool.service.ArticleTailAdvertInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ArticleTailAdvertInfoServiceImpl implements ArticleTailAdvertInfoService {
    @Autowired
    private ArticleTailAdvertInfoMapper articleTailAdvertInfoMapper;

    @Override
    public List<UserAdvertList> getArticleTailAdvertInfo(Integer userId, Integer advertType) {
        return articleTailAdvertInfoMapper.getArticleTailAdvertInfo(userId, advertType);
    }

    @Override
    public void saveArticleTailAdvert(ArticleTailAdvertInfo entity) {
        articleTailAdvertInfoMapper.saveArticleTailAdvert(entity);
    }

    @Override
    public void updateArticleTailAdvert(ArticleTailAdvertInfo entity) {
        articleTailAdvertInfoMapper.updateArticleTailAdvert(entity);
    }

    @Override
    public int deleteArticleTailAdvert(Integer advertId) {
        return articleTailAdvertInfoMapper.deleteArticleTailAdvert(advertId);
    }

    @Override
    public ArticleTailAdvertInfo getAdvertByType(Integer userId, Integer advertType) {
        return articleTailAdvertInfoMapper.getAdvertByType(userId, advertType);
    }

    @Override
    public List<UserAdvertType> getAdvertTypeList(Integer userId, List<Integer> typeIds) {
        return articleTailAdvertInfoMapper.getAdvertTypeList(userId, typeIds);
    }

    @Override
    public ArticleTailAdvertInfo getUserAdvertById(Integer id) {
        return articleTailAdvertInfoMapper.getUserAdvertById(id);
    }

    @Override
    public List<Integer> getUserAdvertTypeList(Integer userId) {
        return articleTailAdvertInfoMapper.getUserAdvertTypeList(userId);
    }
}
